<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="dictGroupList" checkbox="true" fitColumns="true" title="教师预约冲突记录" actionUrl="teacherAppointAuditController.do?datagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol> 
   <t:dgCol title="上课节次"  field="courseOrderEnd" hidden="true"   queryMode="single"  width="100"></t:dgCol> 
   <t:dgCol title="周次"  field="weekNumber" query="true"  queryMode="group"  width="120" 
   		replace='${weekList}'></t:dgCol> 
   <t:dgCol title="专业班级"  field="grade.className"  queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="日期"  field="courseDate" formatter="yyyy-MM-dd"  queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="上课节次"  field="courseOrder" formatterjs="function(v,rec){return rec.courseOrder+'-'+rec.courseOrderEnd}"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="实验课程"  field="lessonInfo.lessonName"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="实验项目"  field="teachItem.itemName"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="任课教师"  field="teacher.realName"   queryMode="single"  width="80"></t:dgCol>
   <t:dgCol title="实验室"  field="lab.labName"   queryMode="single"  width="100"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="180"></t:dgCol>
    
   <t:dgFunOpt funname="ajust(id)" title="调整"></t:dgFunOpt> 
   <t:dgFunOpt funname="doAudit(id)" title="审核通过"></t:dgFunOpt> 
   <t:dgDelOpt title="删除" url="teacherAppointAuditController.do?doDel&id={id}" />

<%--    <t:dgToolBar title="编辑" icon="icon-edit" url="teacherAppointAuditController.do?goUpdate" funname="update" height="180" width="460"></t:dgToolBar>
    <t:dgToolBar title="查看" icon="icon-search" url="teacherAppointAuditController.do?goUpdate" funname="detail" height="180" width="460"></t:dgToolBar>
 --%>  
   </t:datagrid>
  </div>
 </div>
 <script type="text/javascript">
 $(document).ready(function(){
 		//给时间控件加上样式
 		$("#dictGroupListtb").find("input[name='createDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 });
 
 function ajust(id){
	 $.dialog({
			content: 'url:teacherAppointAuditController.do?goAjust&id='+id,
			title:'调整排课信息',
			zIndex: 50,
			lock : true,
			width:500,
			height: 370,
 			opacity : 0.3,
 			ok:function(){
		    	iframe = this.iframe.contentWindow;
		    	$('#btn_sub', iframe.document).click(); 
 				return false;
 			},
			cache:false, 
		    cancelVal: '关闭',
		    cancel: true /*为true等价于function(){}*/
		});
 }
 
 

 function doAudit(id){
	 $.dialog.confirm('你确定要审核通过吗?', function(r) {
		   if (r) {
				 
			   $.ajax({
					 url:"teacherAppointAuditController.do?doAudit&id="+id,
					 success:function(data){
						 data = $.parseJSON(data);
						 tip(data.msg)
						 if(data.success){
							 reloadTable();
						 }
					 }
				 });
			   
			}
		}); 
 }
 
 </script>